remove org.reflections:reflections, only test use it#16456
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR removes the runtime dependency on org.reflections by moving it to test scope and refactoring production code to avoid classpath scanning.
- Shift org.reflections:reflections to test scope across modules and remove it from runtime dependency lists.
- Replace reflection-based discovery in production (MNodeFactoryLoader, SchemaRegionLoader) with explicit class registration; move classpath scanning into tests and change VisibilityTestUtils API accordingly.
- Update CI workflows to use Oracle/Corretto JDK distributions.
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| pom.xml | Marks reflections dependency as test-scoped at the root level. |
| iotdb-core/node-commons/pom.xml | Marks reflections as test-scoped for node-commons. |
| iotdb-core/datanode/pom.xml | Marks reflections as test-scoped and excludes javassist in datanode. |
| iotdb-core/confignode/pom.xml | Adds reflections as test-scoped with javassist exclusion in confignode. |
| iotdb-core/node-commons/src/main/java/.../VisibilityTestUtils.java | Changes public API to accept a Set of PipePlugin classes instead of scanning by package. |
| iotdb-core/*/src/test/java/.../PipePluginAnnotationTest.java | Moves class discovery to tests via Reflections and passes discovered classes to VisibilityTestUtils. |
| iotdb-core/datanode/src/main/java/.../MNodeFactoryLoader.java | Removes Reflections; introduces a static registry of factories and iterates over it. |
| iotdb-core/datanode/src/main/java/.../SchemaRegionLoader.java | Removes Reflections; introduces a fixed set of schema region implementations. |
| dependencies.json | Removes org.reflections from allowed runtime dependencies. |
| .github/workflows/* | Switches setup-java distributions (Oracle/Corretto) across multiple workflows. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| for (Class<?> nodeFactory : nodeFactorySet) { | ||
| if (isGenericMatch(nodeFactory, nodeType) && isEnvMatch(nodeFactory, env)) { | ||
| try { |
There was a problem hiding this comment.
nodeFactorySet is a mutable HashSet exposed via the public addNodeFactory method and iterated without synchronization; concurrent mutation can cause ConcurrentModificationException. Make nodeFactorySet final and immutable after construction (e.g., populate in the constructor and wrap with Collections.unmodifiableSet), or use a thread-safe set such as CopyOnWriteArraySet.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #16456 +/- ##
=========================================
Coverage 38.69% 38.69%
Complexity 207 207
=========================================
Files 4934 4934
Lines 325576 325569 -7
Branches 41369 41368 -1
=========================================
+ Hits 125978 125995 +17
+ Misses 199598 199574 -24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|




No description provided.